<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // document.write('来旅梦，去名企');
        // {}用于创建对象  key: value
        // 男主角
        //  - var let const 区别
        // 未定义？ undefined 值未定义,在内存中的分配没有确定
        let num;
        console.log(num);
        num = 1;
        let a = null;

        let xy = {
            hobbies: ["羽毛球","干饭"],
            name: '徐毅',
            sex: '男',
            hometown: '丰城',
            collage: '东华理工大学',
            room: '512',
            isSingle: true,
            age: 21,
            yz: 90,
            sendFlower(target){
                target.receiveFlower(this);
            }
        }
        // 送花
        // 女主角
        let xh = {
            name: '小红',
            mood: 50,
            receiveFlower(sender){
                if(this.mood < 80){
                    console.log('不接受');
                } else{
                    console.log(this.name + '收到了' + sender.name + '送的花');
                }
            }
        }
        let xm = {
            name: '小美',
            hometown: '丰城',
            receiveFlower(sender){
                setTimeout(() => {
                    xh.mood = 90;
                    xh.receiveFlower(sender);
                },3000)
        }
    }

    </script>
</body>
</html>